<!DOCTYPE html>
<html>
    <head>
        <title>深拷贝 - deepClone的实现</title>
        <script src="../../src/object/deepClone.js"></script>
    </head>
    <body>
        <script>
            const obj = {
                a: 1,
                b: ['e', 'f', 'g'],
                c: { h: 20 },
                d: function () { }
            }

            obj.b.push(obj.c)
            obj.c.j = obj.b

            const result = deepClone(obj)

            // 修改新数据的属性值
            result.a = 2
            result.b[0] = 'x'
            result.c.h = 30

            console.log(obj)
            console.log(result)
        </script>
    </body>
</html>